<template>
	<view class="container">
		<view class="banner">
			<image class="bg" :src="$img_path('/pagesMine/54.png')" mode="widthFix"></image>
			<image class="text" :src="$img_path('/pagesMine/55.png')" mode="widthFix"></image>
		</view>
		<view class="c-t">
			<view class="t-1">
				已邀请好友
			</view>
			<view class="t-2">
				你成功邀请{{arrayList.length}}位好友
			</view>
		</view>
		<view class="list">
			<view v-for="item,index in arrayList" :key="index" class="item">
				<view class="left">
					<image :src="$img_base_url(item.avatar)" mode="aspectFill"></image>
					<view class="one-row">{{item.nickname}}</view>
				</view>
				<view class="right">
					<view class="status">
						已注册
					</view>
					<view class="time">
						注册时间：{{timestampToDate(item.createtime * 1000 )}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import * as api from '@/utils/api/index.js'
	import {
		timestampToDate
	} from '@/utils/utils.js'
	export default {
		data() {
			return {
				arrayList: [],
				timestampToDate:timestampToDate
			};
		},
		onShow() {
			this.shareLists()
		},
		methods: {
			async shareLists() {
				const {
					code,
					data
				} = await api.shareList()
				if (code == 1) {
					this.arrayList = data.data
				}
			}
		},
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}
</style>
<style lang="scss" scoped>
	.container {
		.banner {
			position: relative;

			.bg {
				width: 100%;
				height: 312rpx;
			}

			.text {
				position: absolute;
				top: 98rpx;
				left: 50%;
				transform: translateX(-50%);
				width: 684rpx;
				height: 102rpx;
			}
		}

		.c-t {
			padding: 24rpx 22rpx;
			box-sizing: border-box;

			.t-1 {
				font-weight: bold;
				font-size: 36rpx;
				color: #000000;
				line-height: 50rpx;
			}

			.t-2 {
				font-weight: 400;
				font-size: 28rpx;
				color: #888888;
				line-height: 40rpx;
				margin-top: 8rpx;
			}
		}

		.list {
			.item {
				padding: 22rpx;
				box-sizing: border-box;
				display: flex;
				justify-content: space-between;
				border-bottom: 2rpx solid #EEEEEE;

				.left {
					width: 40%;
					display: flex;
					align-items: center;

					image {
						width: 108rpx;
						height: 108rpx;
						border-radius: 50%;
					}

					view {
						width: calc(100% - 108rpx);
						padding-left: 20rpx;
						box-sizing: border-box;
						font-weight: bold;
						font-size: 32rpx;
						color: #333333;
						line-height: 44rpx;
					}
				}

				.right {
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					align-items: flex-end;

					.status {
						font-weight: 400;
						font-size: 24rpx;
						color: #E72A2A;
						line-height: 34rpx;
					}

					.time {
						font-weight: 400;
						font-size: 24rpx;
						color: #888888;
						line-height: 34rpx;
					}
				}
			}
		}
	}
</style>